const platform = process.platform;
let filePath = "";
switch (platform) {
    case "linux":
        filePath = __dirname + "/global.html";
        break;
    case "win32":
        filePath = __dirname + "\\global.html";
        break;
    default:
        console.log("other platform");
}

//实现文件路径最佳解决方案 使用path模块完成文件路径拼接
const path = require("path");
filePath = path.join(__dirname, "global.html");
console.log(filePath);